﻿using System;

namespace FileSystemCustomClasses
{
	public static class CodeExtensions
	{
		public static void Raise<T>(this EventHandler<T> argHandler, object argSender, T argEvtArgs) where T : EventArgs
		{
			if (argHandler != null) argHandler(argSender, argEvtArgs);
		}

		public static void Raise(this EventHandler argHandler, object argSender, EventArgs argEvtArgs)
		{
			if (argHandler != null) argHandler(argSender, argEvtArgs);
		}

		public static void Raise(this EventHandler argHandler, object argSender)
		{
			if (argHandler != null) argHandler(argSender, EventArgs.Empty);
		}
	}
}